#!/bin/bash

host="$(hostname -i || echo '127.0.0.1')"
port="8081"

if [ "$(curl --fail --silent "$host":"$port"/actuator/health | grep UP)" ]; then
    exit 0
else
  echo "health check failed."
  exit 1
fi